import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
import { RegComponent } from './reg/reg.component';
import { LoginComponent } from './login/login.component';
import { CreateComponent } from './create/create.component';
import { ListComponent } from './list/list.component';
import { HelpComponent } from './help/help.component';

const appRoutes: Routes = [
  {
    path: '',
    pathMatch: 'prefix',
    redirectTo: 'home',
  },
  {
    path: "home",
    component: HomeComponent,
  },
  {
    path: "help",
    component: HelpComponent,
  },
  {
    path: "login",
    component: LoginComponent,
  },
  {
    path: "reg",
    component: RegComponent,
  },
  {
    path: "create",
    component: CreateComponent,
  },
  {
    path: "list",
    component: ListComponent,
  },
];

@NgModule({
  imports: [
    RouterModule.forRoot(appRoutes)
  ],
  exports: [
    RouterModule
  ]
})
export class AppRouting{ }
